package com.yulinlin.jdbc.serialize.impl;

import java.lang.reflect.Field;

public class LongSerialize implements ITypeSerialize<Long,Object> {

    @Override
    public Object serialize(Long o) {
        return o;
    }

    @Override
    public Long unSerialize(Object o, Field field) {
        if (o instanceof Long) {
            return (long) o;
        } else if (o instanceof String){
            return Long.parseLong(o.toString());
        }
        return null;
    }
}
